package com.liwen.kefu.service;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @author: Liwen
 * @createTime: 2024/11/1
 * @description:
 */
public interface ActionDataService {


    /**
     * 手机号查询userId
     *
     * @param mobileNo
     * @return
     */
    String execHiveQueryUserId(String mobileNo, String type);

    /**
     * hive查询
     *
     * @param sql
     * @param tableName
     * @return
     */
    List<Map<String, Object>> execHiveQuery(String sql, String tableName);


    /**
     * list数据导出 excel
     *
     * @param filePath
     * @param list
     * @return
     */
    String exportDataToExcel(String filePath, List<Map<String, Object>> list);


    /**
     * 读取excel，根据key查询对应的value
     *
     * @param excelPath
     * @param key
     * @return
     */
    String getDeleteKeysValue(String excelPath, String key) throws IOException;


    /**
     * 根据key删除sql数据
     *
     * @param ids
     */
    void execSqlDelete(String dbName, String tableName, String key, String ids) throws SQLException;


    /**
     * 读取excel insert to mysql
     *
     * @param excelPath
     * @param dbName
     * @param tableName
     */
    void execMysqlInsert(String excelPath, String dbName, String tableName) throws IOException, SQLException;

    /**
     * 查询mysql导入结果
     *
     * @param key
     * @param ids
     */
    void queryImportResult(String dbName, String tableName, String key, String ids);

    /**
     * 1、根据key获取excel 的value
     * 2、根据value 删除mysql
     * 3、插入mysql
     *
     * @param dbName
     * @param tableName
     * @param filePath
     */
    String excelImportDataToMysql(String dbName, String tableName, String filePath);

    void execSql(String dbName, String sql);
}
